class LinksVotes < ActiveRecord::Migration
  def self.up
    create_table :links do |t|
      t.column :url, :string
      t.column :title, :string
      t.column :blog_id, :integer
      t.column :votes_count, :integer, :default => 0
      t.column :created_at, :datetime
      t.column :bumped_at, :datetime
    end
    
    create_table :votes do |t|
      t.column :link_id, :integer
      t.column :ip_address, :string
      t.column :created_at, :datetime
    end
  end

  def self.down
    drop_table :links
    drop_table :votes
  end
end
